<template>
  <div>
    <div class="wframe">
      <div class="mcontent">
        <div class="top clearfix">
          <div class="top_logo fl">
            <img src="./../../assets/img/logo.png" alt="">
          </div>
          <ul class="top_home fr">
            <li class="fl">
              <router-link to="/login">登录</router-link>
            </li>
            <li class="fl">
              <router-link to="/register">注册</router-link>
            </li>
          </ul>
        </div>
        <p class="mcontent_title">首页>{{title}}</p>
        <div>
          <ul class="list_collection">
            <li class="clearfix" v-for="item in collection">
              <p class="fl p1">{{item.text}}</p>
              <p class="fr">{{item.timeStr}}</p>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        collection: [],
        title:this.$route.query.title
      }
    },
    mounted() {
      this.newp();
    },
    methods: {
      newp() {
        this.axios.get(this.lib.config.host.system + '/portal/query')
          .then((response) => {
            if(this.$route.query.title=='采购公告'){
              this.collection = response.data[1];
            }else if(this.$route.query.title=='网站公告'){
              this.collection = response.data[2];
            }else if(this.$route.query.title=='新闻政策'){
              this.collection = response.data[3];
            }else if(this.$route.query.title=='用户须知'){
              this.collection = response.data[4];
            }
            
          })
          .catch((error) => {
            console.log(error);
          });
      }

    }
  }

</script>
